const Toast = {
	T: "top",
	B: "bottom",
	L: "left",
	C: "center",
	R: "right"
};

function _color_toast(msg, parent, t, pos, color) {
	t = t ? t : 2000;
	pos = pos ? pos : [Toast.B, Toast.C];
	color = color ? color : "linear-gradient(to right, #00b09b, #96c93d)";
	parent = parent ? parent : document.documentElement;
	Toastify({
     	text: msg,
    	duration: t,
    	gravity: pos[0],
    	position: pos[1],
    	selector: parent,
    	style: {
			background: color,
		}
	}).showToast();  
}

function _fs_toast_info(msg, parent, t, pos) {
	_color_toast(msg, parent, t, pos, "linear-gradient(to right top, #22d6c6, #17ddad, #47e18a, #76e35e, #a5e11f)");
}

function _fs_toast_error(msg, parent, t, pos) {
	_color_toast(msg, parent, t, pos, "linear-gradient(to right top, #ff0000, #ff001a, #ff002a, #ff0037, #ff0043)");
}

function _fs_toast_warning(msg, parent, t, pos) {
	_color_toast(msg, parent, t, pos, "linear-gradient(to right top, #ae1818, #bd3917, #ca5418, #d66c1a, #e1841f)");
}

Toast.info = _fs_toast_info;
Toast.error = _fs_toast_error;
Toast.warning = _fs_toast_warning;
